package com.lin.Demo;

import com.lin.domain.Article;

// Demo
class Demo {
    public static void main(String args[]) throws  Exception{
        CustomerJsonSerializer cjs= new CustomerJsonSerializer();
        // 设置转换 Article 类时，只包含 id, name
        cjs.filter(Article.class, "id,title", null);

        String include = cjs.toJson(new Article());

        cjs = new CustomerJsonSerializer();
        // 设置转换 Article 类时，过滤掉 id, name
        cjs.filter(Article.class, null, "id,title");

        String filter = cjs.toJson(new Article());

        System.out.println("include: " + include);
        System.out.println("filter: " + filter);
    }
}
